package com.fz.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fz.core.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

/**
 * <p>
 * 存储话题评论信息
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("topic_comment")
public class TopicComment extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 话题ID（外键）
     */
    private Long topicId;

    /**
     * 用户ID（外键）
     */
    private Long userId;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 逻辑删除（1=删除）
     */
    private Integer isDeleted;

    public TopicComment(Long topicId,Long userId,String content) {
        this.topicId=topicId;
        this.userId = userId;
        this.content=content;
        this.createTime=LocalDateTime.now();
        this.updateTime=LocalDateTime.now();
        this.isDeleted=0;
    }
}
